package cn.rubintry.bug.hunting.adapter

import cn.rubintry.bug.hunting.pojo.HomeBackgroundModel
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder

class MBannerAdapter(private val data: List<HomeBackgroundModel>) : BannerImageAdapter<HomeBackgroundModel>(data) {
    override fun onBindView(holder: BannerImageHolder?, data: HomeBackgroundModel?, position: Int, size: Int) {
        holder?.imageView?.let {
            Glide.with(it.context)
                .load(data?.url)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .into(it)
        }
    }
}